package com.sright.bcard.content.dal.dao.impl;

import com.sright.bcard.common.service.share.base.dao.BaseDAOImpl;
import com.sright.bcard.common.service.share.base.dao.BaseMapper;
import com.sright.bcard.common.service.share.dto.page.PageParamRequest;
import com.sright.bcard.content.dal.dao.TemplateDAO;
import com.sright.bcard.content.dal.entity.TemplateDO;
import com.sright.bcard.content.dal.mapper.TemplateDOMapper;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;
import java.util.List;

@Repository
public class TemplateDAOImpl extends BaseDAOImpl<TemplateDO> implements TemplateDAO {

    @Resource
    private TemplateDOMapper templateDOMapper;

    @Override
    protected BaseMapper<TemplateDO> getObjMapper() {
        return templateDOMapper;
    }

    @Override
    public Integer count(String keyword) {
        return templateDOMapper.count(keyword);
    }

    @Override
    public List<TemplateDO> selectByName(String keyword, PageParamRequest request) {
        return templateDOMapper.selectByKeyword(keyword, request);
    }

    @Override
    public List<TemplateDO> selectByType(int type) {
        return templateDOMapper.selectByType(type);
    }

    @Override
    public List<TemplateDO> allTemplateList() {
        return templateDOMapper.allTemplateList();
    }

    @Override
    public List<TemplateDO> templates() {
        return templateDOMapper.templates();
    }
}
